/**
 * @author Johannes Blersch
 * 
 * @since 10.05.2011
 * 
 *  Is subclass of JPanel for displaying the images of the player figures.
 */
package view;

import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

public class FigurePanel extends JPanel {
	
	private ImageIcon figure;
	private int paddingLeft;
	
	////////////////////////////////////////////////////////////
	//// Constructor										////
	////////////////////////////////////////////////////////////
	
	FigurePanel(){};
	
	/**
	 * Creates a figure panel object and sets the displayed figure image.
	 * 
	 * @param picture The Picture which should become displayed.
	 * @param padLeft The space between the left border of the image and the left border of the panel.
	 */
	public FigurePanel(ImageIcon picture, int padLeft)	{
		super();
		figure = picture;
		paddingLeft = padLeft;
	}
	
	/**
	 * Standard Method for drawing the panel. It accessorily draws the figure image on the panel.
	 */
	public void paint(Graphics g)
	{
		super.paint(g);
		g.drawImage(figure.getImage(), paddingLeft, 0, this);
	}

}
